Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving the FlowAdapters into the core jar as a solution to #424 #430

Merged
merged 1 commit into from
May 18, 2018

Conversation

viktorklang
Copy link
Contributor

Solves #424 by moving the FlowAdapters into the main jar and retires the flow-adapters artifact.

@reactive-streams/contributors Thoughts?

@viktorklang viktorklang added this to the 1.0.3 milestone May 2, 2018
@viktorklang viktorklang self-assigned this May 2, 2018
@akarnokd
Copy link
Contributor

akarnokd commented May 2, 2018

Will you be able to build the flow adapter class with javac 9 while keeping the other class files as Java 6?

@viktorklang
Copy link
Contributor Author

@akarnokd Everything will be compiled with source and target 1.6, but FlowAdapters will only be linked/used in the build if compiled against jdk9+ (conditional sources).

@viktorklang
Copy link
Contributor Author

@reactive-streams/contributors Anyone?

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing additional docs on FlowAdapters as we discussed in the ticket before.

Add additional docs about that this class will only be usable in JDK9+ but that is fine etc.

LGTM otherwise, I can confirm shipping classes like this works fine.

@ktoso
Copy link
Contributor

ktoso commented May 14, 2018

Sanity check the:

Everything will be compiled with source and target 1.6, but FlowAdapters will only be linked in the build if compiled against jdk9+

as I'm missing where the magic that does this in our build is here. If it indeed does so, this is ready, except the minor docs addition requested above.

@akarnokd
Copy link
Contributor

To be clear, if this can be done so that all .class files in the jar are in Java 6's file format, that would be great. This way, tools for Android would not freak out to a mixed-version file.

@ktoso
Copy link
Contributor

ktoso commented May 15, 2018

It has to be done such that those are java 6 format.

We do so in Akka where most classes (in the same jar) are JDK8 yet the Flow.* using ones are JDK9 compiled; the same has to be done here with regards to Java 6; which is why I'm asking if we confirmed this actually is happening now.

@ktoso
Copy link
Contributor

ktoso commented May 18, 2018

ping @viktorklang can you confirm the result is really the expected one?

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured it'll be quicker if I checked I guess.
It's all JDK6 format, which is fine. (and confirms my confusion that we did not do anything special to compile the java9 files in Java9 class format, but that's not really needed).

Class format is 50 everywhere, which is fine, the adapters project does not need to be compiled in format 52 after all, it only has to "touch" the JDK9 classes during compilation, and not compiling in runtime relates to the classes as well, not the format; we're okey here.

wip-424 u=!reactive-streams $> jenv local
9
wip-424 u=!reactive-streams $> java -version
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
wip-424 u=!reactive-streams $> ./gradlew install
   INFO: ------------------ JDK9 classes detected ---------------------------------
   INFO: Java 9 Flow API found; Including [tck-flow] & FlowAdapters in build.
   INFO: --------------------------------------------------------------------------

BUILD SUCCESSFUL in 3s
32 actionable tasks: 4 executed, 28 up-to-date
wip-424 u=!reactive-streams $> javap -v api/build/classes/java/main/org/reactivestreams/Subscriber.class | grep version
  minor version: 0
  major version: 50
wip-424 u=!reactive-streams $> javap -v api/build/classes/java/main/org/reactivestreams/FlowAdapters.class | grep version
  minor version: 0
  major version: 50
wip-424 u=!reactive-streams $> echo "Java 6 uses major version 50."
Java 6 uses major version 50.

In other words LGTM

@viktorklang
Copy link
Contributor Author

viktorklang commented May 18, 2018 via email

@viktorklang
Copy link
Contributor Author

@reactive-streams/contributors Merging!

@viktorklang viktorklang merged commit 138c473 into master May 18, 2018
@viktorklang viktorklang deleted the wip-424-√ branch May 18, 2018 10:43
@akarnokd
Copy link
Contributor

Some users on Android + ProGuard have run into some issues due to the mixed RS jar file: ReactiveX/RxJava#6670. This would affect any library depending on RS 1.0.3+ under similar circumstances.

Would the README.md of this repo a good place to document this case and the workarounds?

@viktorklang
Copy link
Contributor Author

Perhaps open a question on SO? Seems like a very specific issue related to a tool. (not finding a type which is not called in the codebase seems like a no-problem).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants